<?php
/*

  Released under the GNU General Public License
*/

// change lines marked with CHANGE THIS!

  class joomlastyle {  // CHANGE THIS!
    var $code, $title, $description, $icon, $enabled;

// class constructor
    function joomlastyle() { // CHANGE THIS!

      $this->code = 'joomlastyle'; // CHANGE THIS!
      $this->title = 'Use Joomla Style Sheet'; // CHANGE THIS!
      $this->description = 'Use Joomla Style Sheet'; // CHANGE THIS!
      $this->sort_order = 0;
      $this->icon = '';
      $this->enabled = ((MODULE_THEMES_JOOMLASTYLE_STATUS == 'True') ? true : false); // CHANGE THIS!

    }

// class methods

    function check() {
      if (!isset($this->_check)) {
        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_THEMES_JOOMLASTYLE_STATUS'"); // CHANGE THIS!
        $this->_check = tep_db_num_rows($check_query);
      }
      return $this->_check;
    }

    function install() {
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable JoomlaStyle Theme?', 'MODULE_THEMES_JOOMLASTYLE_STATUS', 'True', 'Enable JoomlaStyle Theme?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); // CHANGE THIS!
      tep_db_query("update `". TABLE_CONFIGURATION . "` SET `configuration_value`='themes/joomlastyle/themeconfig.php' WHERE `configuration_key`='THEME_CURRENT_CONFIG'"); // CHANGE THIS!

    }

    function remove() {
      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
    }

    function keys() {
      return array('MODULE_THEMES_JOOMLASTYLE_STATUS'); // CHANGE THIS!
    }
  }
?>
